<!-- /templates/page.contact.liquid -->
{% comment %}

  This page template is a requirement if you are submitting your theme to the Shopify Theme Store.
  Be sure to select page.contact as the template from the admin page to have this template take effect.

  For information on adding more fields, visit:
    - http://docs.shopify.com/support/configuration/store-customization/adding-fields-to-the-liquid-contact-form

{% endcomment %}

<div class="grid">

  <div class="grid__item large--two-thirds push--large--one-sixth">

    <h1>{{ page.title }}</h1>

    {% comment %}
      Regular page content goes here.
    {% endcomment %}
    <div class="rte">
      {{ page.content }}
    </div>

    {% comment %}
      Contact form starts here
    {% endcomment %}
    <div>
      {% form 'contact' %}

        {% comment %}
          Successful message
        {% endcomment %}
        {% if form.posted_successfully? %}
          <p class="note form-success">
            {{ 'contact.form.post_success' | t }}
          </p>
        {% endif %}

        {{ form.errors | default_errors }}

        {% assign name_attr = 'contact.form.name' | t | handle %}
        <label for="ContactFormName" class="label--hidden">{{ 'contact.form.name' | t }}</label>
        <input type="text" id="ContactFormName" name="contact[{{ name_attr }}]" placeholder="{{ 'contact.form.name' | t }}" autocapitalize="words" value="{% if form[name_attr] %}{{ form[name_attr] }}{% elsif customer %}{{ customer.name }}{% endif %}">

        <label for="ContactFormEmail" class="label--hidden">{{ 'contact.form.email' | t }}</label>
        <input type="email" id="ContactFormEmail" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">

        {% assign name_attr = 'contact.form.phone' | t | handle %}
        <label for="ContactFormPhone" class="label--hidden">{{ 'contact.form.phone' | t }}</label>
        <input type="tel" id="ContactFormPhone" name="contact[{{ name_attr }}]" placeholder="{{ 'contact.form.phone' | t }}" pattern="[0-9\-]*" value="{% if form[name_attr] %}{{ form[name_attr] }}{% elsif customer %}{{ customer.phone }}{% endif %}">

        <label for="ContactFormMessage" class="label--hidden">{{ 'contact.form.message' | t }}</label>
        <textarea rows="10" id="ContactFormMessage" name="contact[body]" placeholder="{{ 'contact.form.message' | t }}">{% if form.body %}{{ form.body }}{% endif %}</textarea>

        <input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">

      {% endform %}
    </div>

  </div>

</div>
